<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="style/css/common.css" type="text/css" />
<title>分类管理</title>
<SCRIPT src="style/js/jquery-1.3.2.min.js" type=text/javascript></SCRIPT>
<SCRIPT src="style/js/main.js" type=text/javascript></SCRIPT>
<SCRIPT src="style/js/jquery-ui-1.7.2.custom.min.js" type=text/javascript></SCRIPT>
<LINK href="style/css/jquery-ui-1.7.2.custom.min.css" type=text/css rel=stylesheet>
<script language="javascript">
$(document).ready(function(){
	$(".cbg").hover(function(){$(this).css("background-color","#F3F8F7")},function(){$(this).css("background-color","")});
});
</script>
</head>
<body>
<div id="man_zone">
<form action="index.php?m=classify&a=add" method="post">
<table width="100%" border="0" align="center" cellpadding="1" cellspacing="1" class="table_style">
  <tr>
    <td colspan="2" style="text-align:left;" class="left_title_1">添加分类</td>
    </tr>
  <tr>
    <td>分类名称:</td>
    <td><label for="textfield">
      <input type="text" name="name" id="name" /></label>
    </td>
  </tr>
  <tr>
    <td bgcolor="#F9F9F9">隶属大类:</td>
    <td><label for="select">
      <select name="pid" id="pid">
        <option value="0" selected="selected">无(作为一级分类)</option>
        <%foreach item=val from=$classify%>
        <%if $val.level eq 0%>
        <%assign var=cid value=$arg.cid%>
        <option value="<%$val.cid%>"<%if $cid eq $val.cid || $classify.c.$cid.pid eq $val.cid%> selected="selected"<%/if%>><%$val.name%></option>
        <%/if%>
        <%/foreach%>
      </select></label></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><input type="submit" name="button" id="button" value="提交" /></td>
  </tr>
</table>
</form>
<br />
<table  width="100%" border="0" align="center" cellpadding="1" cellspacing="1" class="table_style">
  <tr>
    <td colspan="4" style="text-align:left;" class="left_title_1">编辑分类</td>
  </tr>
  <tr align="center">
    <td>id</td>
    <td>分类名称</td>
    <td>操作</td>
  </tr>
	<%foreach item=val from=$classify%>
	<tr class="cbg">
        <td align="center"><%$val.cid%></td>
        <%math equation="(x+y)*z" x=$val.level y=1 z=20  assign=padding%>
        <td style="padding-left:<%$padding%>px;">
            <div id="name_<%$val.cid%>">
                |-- <a href="index.php?m=website&cid=<%$val.cid%>"><%$val.name%></a>
            </div>
        </td>
        <td align="center">
            <a href="javascript:;" class="rename" cid="<%$val.cid%>" name="<%$val.name%>" id="rename_<%$val.cid%>">重命名</a> 
            <a href="index.php?m=classify&amp;a=delete&amp;cid=<%$val.cid%>&pid=<%$val.cid%>" class="delete">删除</a>
        </td>
      </tr>
      <%assign var=cid value=$val.cid%>
      <%foreach item=value from=$websites.$cid%>
      	<tr class="cbg">
        <td align="center"></td>
        <td style="padding-left:<%math equation="(x+y)" x=$padding  y=20%>px;">
            └-- <a href="index.php?m=website&a=attribute&wid=<%$value.wid%>"><%$value.domain%></a>
        </td>
        <td align="center">
            
        </td>
      </tr>
      <%/foreach%>
    <%/foreach%>
  <tr>
    <td colspan="4"></td>
  </tr>
</table>
</div>

<DIV id=init_page_dialog title="重命名" style="display:none;">
        <input type="text" id="renameInput" value="" class="size" />
        </DIV>
        
        <DIV id="moveDialog" title="重命名" style="display:none;">
        <label for="select">请选择目标分类:
        <select name="pid" id="pid">
        <option value="0" selected="selected">无(作为一级分类)</option>
        <%foreach item=val from=$classify.p%>
        <option value="<%$val.cid%>"><%$val.name%></option>
        <%/foreach%>
        </select></label>
        </DIV>
</body>
</html>
